#!/usr/bin/python

# Author: Santiago Sanchez Paz
# Em ail: sanchezpaz (a) gmail.com

import wx
import os

class MainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=wx.DisplaySize())
        menubar = wx.MenuBar()
        file = wx.Menu()
        edit = wx.Menu()
        help = wx.Menu()
        menubar.Append(file, '&File')
        menubar.Append(edit, '&Edit')
        menubar.Append(help, '&Help')
        file.Append(1000, '&Open\tCtrl+O', 'Open a file')
        file.Append(1001, '&Rediff\tCtrl+R', 'Rediff')
        file.Append(1002, 'Re&display\tCtrl+D', 'Redisplay')
        file.Append(1003, '&MakePatch\tCtrl+M', 'Make Patch')
        file.Append(1004, '&Touch\tCtrl+T', 'Touch')
        file.Append(1005, '&ExcludeSelection\tCtrl+E', 'Exclude Selection')
        file.Append(1006, '&Stop\tCtrl+S', 'Stop')
	quit = wx.MenuItem(file, 1007, '&Quit\tCtrl+Q', 'Quit the Application')
	quit.SetBitmap(wx.Image('/usr/share/icons/gnome/16x16/actions/gtk-quit.png',wx.BITMAP_TYPE_PNG).ConvertToBitmap())
	wx.EVT_MENU(self, 1000, self.Open)
	wx.EVT_MENU(self, 1007, self.OnQuit)
	file.AppendItem(quit)
	help.Append(1008, '&About', 'About dirdiff')
        self.SetMenuBar(menubar)
	self.CreateStatusBar()

	panel1 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
	panel2 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)

	self.texto = wx.StaticText(panel1, -1, 'File', (45, 25), (200,20), style=wx.ALIGN_CENTRE|wx.BORDER)
        self.textEntry = wx.TextCtrl(panel1, -1, '',(45,150),(100,20))

	self.tc1 = wx.TextCtrl(panel1, -1)
	vbox3 = wx.GridSizer(2,2,0,0)
	vbox3.AddMany([ (wx.StaticText(panel1, -1, 'State'),0, wx.ALIGN_CENTER),
			(self.tc1, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL),
			(wx.StaticText(panel1, -1, 'Capital'),0, wx.ALIGN_CENTER_HORIZONTAL)])
	panel1.SetSizer(vbox3)

        self.Centre()
        self.Show(True)
    def OnQuit(self, event):
	self.Close()
    def Open(self, event):
	dlg1 = wx.FileDialog(None, "Open a file", os.getcwd())
	dlg1.SetStyle(wx.OPEN)
	wildcard = "Python files (.py)|*.py|PythonW files (.pyw)|*.pyw|All files (*.*)|*.*"
	dlg1.SetWildcard(wildcard)
	dlg1.ShowModal()
	self.texto.SetLabel(dlg1.GetPath())
	dlg1.Destroy()

app = wx.App()
MainFrame(None, -1, 'dirdiff')
app.MainLoop()
